package com.dailyblue.java.project.smbms.user.bean;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dailyblue.java.commons.util.JsonResult;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@TableName("smbms_user")
@NoArgsConstructor
public class User implements Serializable {
    private Integer id;
    private String userCode;
    private String userName;
    private String userPassword;
    private Integer gender; //1女2男
    @TableField(exist = false)
    private String userSex;
    private String birthday;
    @TableField(exist = false)
    private Integer userAge;
    private String phone;
    private String address;
    private Integer userRole;
    @TableLogic(delval = "0", value = "1")
    private Integer userState;
    @TableField(exist = false)
    private JsonResult role;

    public User(String userCode, String userName, String userPassword, Integer gender, String birthday, String phone, String address, Integer userRole) {
        this.userCode = userCode;
        this.userName = userName;
        this.userPassword = userPassword;
        this.gender = gender;
        this.birthday = birthday;
        this.phone = phone;
        this.address = address;
        this.userRole = userRole;
    }

    public User(Integer id, String userName, Integer gender, String birthday, String phone, String address, Integer userRole) {
        this.id = id;
        this.userName = userName;
        this.gender = gender;
        this.birthday = birthday;
        this.phone = phone;
        this.address = address;
        this.userRole = userRole;
    }
}
